Skip to content

Comments

Add test to validate examples in the main PALS repository#55

Open
EZoni wants to merge 23 commits intopals-project:mainfrom
EZoni:run_examples_from_pals
Open

Add test to validate examples in the main PALS repository#55
EZoni wants to merge 23 commits intopals-project:mainfrom
EZoni:run_examples_from_pals

Conversation

@EZoni
Copy link
Member

@EZoni EZoni commented Dec 17, 2025

Overview

This PR adds to the main CI workflow a new step that tests the examples in the main PALS repository.

The test goes as follows:

  • Clone the examples/ directory from the main PALS repository.
  • Loop over all *.pals.yaml files in the examples/ directory and read, parse, and validate the data from each file.

This makes sure that the Python implementation is actually consistent with the examples in the main PALS repository.

The examples within the PALS Python repository are labeled "internal", while the ones within the main PALS repository are labeld "upstream".

To do

  • Fix the Python implementation and/or the examples in the main PALS repository.
  • Add as separate CI workflow (instead of separate step in the existing workflow).
  • Merge Add Lattice class #59 and rebase.
  • Merge Add PlaceholderName #60 and rebase.

@EZoni EZoni added the CI/CD label Dec 17, 2025
@EZoni EZoni force-pushed the run_examples_from_pals branch from c78a626 to 085fc2c Compare December 17, 2025 18:12
@EZoni

This comment was marked as outdated.

@EZoni EZoni requested review from ax3l and cemitch99 December 17, 2025 18:20
@EZoni

This comment was marked as outdated.

@ax3l

This comment was marked as outdated.

@EZoni

This comment was marked as outdated.

- Copy implementation from BeamLine to Lattice
- Move methods from_file, to_file from BeamLine to Lattice
- Use new class in external examples test script
@EZoni

This comment was marked as outdated.

@ax3l

This comment was marked as outdated.

@EZoni EZoni mentioned this pull request Feb 17, 2026
3 tasks
@ax3l ax3l mentioned this pull request Feb 19, 2026
@EZoni EZoni force-pushed the run_examples_from_pals branch from f547269 to 0a9732d Compare February 19, 2026 19:57
@EZoni EZoni force-pushed the run_examples_from_pals branch from bc42b84 to b95a0d8 Compare February 19, 2026 20:04
@EZoni EZoni force-pushed the run_examples_from_pals branch from b95a0d8 to 0e9b38d Compare February 19, 2026 20:05
@EZoni EZoni changed the title [WIP] Add test to validate examples in the main PALS repository Add test to validate examples in the main PALS repository Feb 19, 2026
@EZoni EZoni requested a review from Copilot February 19, 2026 21:05
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds validation testing for examples in the upstream PALS repository to ensure consistency between the Python implementation and the official examples. The PR refactors the existing CI workflow into three separate workflows (unit tests, local examples, and upstream examples) and adds support for a new - use: element_name syntax for referencing elements in YAML files.

Changes:

  • Split monolithic CI workflow into three separate workflows for better organization
  • Added new upstream examples validation workflow that clones and tests examples from the main PALS repository
  • Added support for - use: element_name syntax as an alternative to plain string element references

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
tests/test_upstream_examples.py New test script to validate upstream PALS examples by loading and parsing them
src/pals/kinds/mixin/all_element_mixin.py Added handling for - use: element_name syntax to support upstream examples
.github/workflows/upstream_examples.yml New workflow to test upstream PALS repository examples
.github/workflows/unit_tests.yml Refactored workflow focusing only on pytest unit tests
.github/workflows/local_examples.yml Refactored workflow focusing only on local example scripts
Comments suppressed due to low confidence (1)

.github/workflows/local_examples.yml:19

  • Python 3.14 is included in the test matrix, but as of February 2026, Python 3.14 has not been officially released yet (the latest stable release is Python 3.13). This will cause the GitHub Actions workflow to fail when trying to set up this Python version. Consider removing "3.14" from the matrix until it's officially available, or use the 3.14-dev version explicitly if you want to test against development builds.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@EZoni EZoni requested a review from ax3l February 20, 2026 19:25

concurrency:
group: ${{ github.ref }}-${{ github.head_ref }}-pals-python
group: ${{ github.ref }}-${{ github.head_ref }}-local-examples
Copy link
Member

@ax3l ax3l Feb 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the name local is confusing.

Maybe inrepo vs standard/upstream repo?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had done some brainstorming on this and came up with the pair local/upstream, but let's revisit as you suggest.

Regarding inrepo, I would prefer to use a real single word (rather than a "crasis" of two words), if possible.

I propose some alternative pairs here, let me know if you like any of these:

  • repo/standard
  • repo/reference
  • implementation/standard
  • implementation/reference

The rationale behind implementation being that these are the examples shipped with the Python implementation of the standard, rather than the examples shipped with the standard itself.

Copy link
Member

@ax3l ax3l Feb 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe just examples?

This refers to the local repo anyway by default and the other one is "standard/online examples"?

Copy link
Member

@ax3l ax3l left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great!

Just three small comments to make sure this is well-named and a bit more documented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants